﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace CMS.Entities
{
    [Table("Blog")]
    public class Blog
    {
        [Key]
        public string ID { get; set; }
        public string Name { get; set; }
        public bool Show { get; set; }
        public int Order { get; set; }
        public virtual List<Post> Posts { get; set; }
    }
    [Table("Post")]
    public class Post
    {
        [Key]
        public string ID { get; set; }
        public string Title { get; set; }
        public string Content { get; set; }
        public bool Show { get; set; }
        public bool Feature { get; set; }
        public DateTime DateCreate { get; set; }
        public DateTime? LastDateModify { get; set; }
        public string UserID { get; set; }
        public string LastUserID { get; set; }
        public string Tags { get; set; }
        [ForeignKey("Blog")]
        public string BlogID { get; set; }
        public virtual Blog Blog { get; set; }
        public virtual List<Comment> Comments { get; set; }

    }
    public class Comment
    {
        [Key]
        public string ID { get; set; }
        [ForeignKey("Post")]
        public string PostID { get; set; }
        public virtual Post Post { get; set; }
        public string UserID { get; set; }
        public string Content { get; set; }
        public DateTime DateCreate { get; set; }
    }
}